package com.palrevo.listeners;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import com.palrevo.beackBeans.ApplicationBean;
import com.palrevo.utils.WebUtils;

/**
 * Application Lifecycle Listener implementation class AppServletContextListener
 * @author AAsha
 *
 */
@WebListener
public class AppServletContextListener implements ServletContextListener {

	/**
     * @see ServletContextListener#contextInitialized(ServletContextEvent)
     */
    public void contextInitialized(ServletContextEvent arg0) {
    	ApplicationBean appBean = WebUtils.getApplicationBean();
    	try {
			appBean.loadSiteContents();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
    
	/**
     * @see ServletContextListener#contextDestroyed(ServletContextEvent)
     */
    public void contextDestroyed(ServletContextEvent arg0) {
    }
	
}
